<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>王莹,生日快乐</title>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<style type="text/css">
		@font-face {
			font-family: digit;
			src: url('digital-7_mono.ttf') format("truetype");
		}
	</style>
	<link href="css/default.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/garden.js"></script>
    <script type="text/javascript" src="js/functions.js"></script>
</head>

<body>
	<div id="mainDiv">
		<div id="content">
			<div id="code">
				<span class="comments">/**</span><br />
				<span class="space"/><span class="comments"  style="font-size:20px">* 爱原来很容易,</span><br />
				<span class="space"/><span class="comments">* Your number was u the first time I met you.</span><br />
				<span class="space"/><span class="comments">*/</span><br />
				Boy i = <span class="keyword">new</span> Boy(<span class="string">"赵林博"</span>);<br />
				Girl u = <span class="keyword">new</span> Girl(<span class="string">"王莹"</span>);<br />
				<span class="comments">// Feb 4, 2018, I told you I love you. </span><br />
				i.love(u);<br />
				<span class="comments">// Luckily, you accepted and became my girlfriend eversince.</span><br />
				u.accepted();<br />
				<span class="comments">// 曾几何时，在众说纷纭中彷徨.</span><br />
				i.miss(u);<br />
				<span class="comments">// 曾几何时，没有找到幸福的坚强.</span><br />
				i.takeCareOf(u);<br />
				<span class="comments">// 直到你的出现，生命中有了照亮前路的阳光，我爱你！.</span><br />
				<span class="comments">// 不论天涯海角，我的灵魂在你那里，爱你的心不离不弃。.</span><br />
				<span class="keyword">boolean</span> isHesitate = <span class="keyword">true</span>;<br />
				<span class="keyword">while</span> (isHesitate) {<br />
				<span class="placeholder"/>i.waitFor(u);<br />
				<span class="placeholder"/><span class="comments">//生日快乐,你永远都是最美的</span><br />
				<span class="placeholder"/><span class="comments">//不长,只此一生.</span><br />
				<span class="placeholder"/>isHesitate = u.thinkOver();<br />
				}<br />
				<span class="comments" style="font-size:10px">// 我爱你.</span><br />
				<span class="comments" style="font-size:15px">// 我爱你.</span><br />
				<span class="comments" style="font-size:20px">// 我爱你.</span><br />
				<span class="comments">//  I feel very protective of you.</span><br />
				i.marry(u);<br />
				i.liveHappilyWith(u);<br />
			</div>
			<div id="loveHeart">
				<canvas id="garden"></canvas>
				<div id="words">
					<div id="messages">
						王莹, I have fallen in love with you for,happy birthday!
						<div id="elapseClock"></div>
					</div>
					<div id="loveu">
						Love u forever and ever.<br/>
						<div class="signature">- 赵林博</div>
					</div>
				</div>
			</div>
		</div>
		<div id="copyright">
			Inspired by <a href="http://www.openrise.com/lab/FlowerPower/">FlowerPower</a> project.<br />
			Copyright © 2011 <a href='http://zhaolinbo.me'>zhaolinbo.me</a> 2018-2018
		</div>
	</div>
	<script type="text/javascript">
		var offsetX = $("#loveHeart").width() / 2;
		var offsetY = $("#loveHeart").height() / 2 - 55;
		var together = new Date();
		together.setFullYear(2018, 2, 4);
		together.setHours(20);
		together.setMinutes(0);
		together.setSeconds(0);
		together.setMilliseconds(0);
		
		if (!document.createElement('canvas').getContext) {
			var msg = document.createElement("div");
			msg.id = "errorMsg";
			msg.innerHTML = "Your browser doesn't support HTML5!<br/>Recommend use Chrome 14+/IE 9+/Firefox 7+/Safari 4+"; 
			document.body.appendChild(msg);
			$("#code").css("display", "none")
			$("#copyright").css("position", "absolute");
			$("#copyright").css("bottom", "10px");
		    document.execCommand("stop");
		} else {
			setTimeout(function () {
				startHeartAnimation();
			}, 5000);

			timeElapse(together);
			setInterval(function () {
				timeElapse(together);
			}, 500);

			adjustCodePosition();
			$("#code").typewriter();
		}
		/*  //音乐自动播放
        $(document).ready(function(){
            autoPlayMusic();
            audioAutoPlay();
        });
        function audioAutoPlay() {
            var audio = document.getElementById('bg-music');
            audio.play();
            document.addEventListener("WeixinJSBridgeReady", function () {
                audio.play();
            }, false);
        }
        // 音乐播放
        function autoPlayMusic() {
            // 自动播放音乐效果，解决浏览器或者APP自动播放问题
            function musicInBrowserHandler() {
                musicPlay(true);
                document.body.removeEventListener('touchstart', musicInBrowserHandler);
            }
            document.body.addEventListener('touchstart', musicInBrowserHandler);
            // 自动播放音乐效果，解决微信自动播放问题
            function musicInWeixinHandler() {
                musicPlay(true);
                document.addEventListener("WeixinJSBridgeReady", function () {
                    musicPlay(true);
                }, false);
                document.removeEventListener('DOMContentLoaded', musicInWeixinHandler);
            }
            document.addEventListener('DOMContentLoaded', musicInWeixinHandler);
        }
        function musicPlay(isPlay) {
            var media = document.querySelector('#bg-music');
            if (isPlay && media.paused) {
                media.play();
            }
            if (!isPlay && !media.paused) {
                media.pause();
            }
        } */
        $(document).ready(function () {  
            if (!sessionStorage.getItem("bgm")) {  
                 $("#bgmvideo").append(  
                    '<audio src="http://sc1.111ttt.cn/2016/1/09/23/202230628178.mp3" autoplay hidden></audio>'  
                );  
                sessionStorage.setItem("bgm", 1)  
            }  
        })
	</script>
	<audio src="js/zhaolinbo.mp3" autoplay="autoplay">
</body>
</html>
